# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=asteroid-btsyncd
pkgver=0_git20211128
pkgrel=0
_commit="d142416ac0d0442e354c2c5b9fbce0b9db9ea36f"
pkgdesc="Bluetooth Low Energy synchronization daemon for AsteroidOS"
url="https://github.com/AsteroidOS/asteroid-btsyncd"
# armhf blocked by nemo-qml-plugin-systemsettings
arch="all !armhf"
license="GPL-3.0-or-later"
makedepends="
	extra-cmake-modules
	glibmm-dev
	nemo-qml-plugin-systemsettings-dev
	qml-asteroid-dev
	qt5-qtbase-dev
	qtmpris-dev
	timed-dev
	"
source="https://github.com/AsteroidOS/asteroid-btsyncd/archive/$_commit/asteroid-btsyncd-$_commit.tar.gz
	asteroid-btsyncd.desktop
	"
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 "$srcdir"/asteroid-btsyncd.desktop -t "$pkgdir"/etc/xdg/autostart/
}

sha512sums="
c13c3e497c9ce4e9fe4120a56efe23ad89cfd06cc404001a0db6727f2af8f5be43ed27dbca2aecd76f686b5bec5f24b489f2cc534109d27d3cc23da6bf18bcb8  asteroid-btsyncd-d142416ac0d0442e354c2c5b9fbce0b9db9ea36f.tar.gz
c6d1f3e1870c9bf0c65dc25961f58c3277149f6f7cc141bf0fd89ead191a1d9d72c3c414485f9b1b6407f066e51949b17be8eeb2473dcafb2e2bc5af1015b903  asteroid-btsyncd.desktop
"
